<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:s="http://jboss.com/products/seam/taglib"
      xmlns:a="http://richfaces.org/a4j">

<ui:composition template="/content/templates/myMenuTemplate.xhtml">
    <ui:param name="selectedMenuSub1" value="password"/>
    <ui:define name="title">#{labels['CHANGING_PASSWORD']}</ui:define>
    <ui:decorate template="/content/templates/contentDecorator.xhtml">

        <h:form>
            <table class="loginForm">
                <tr>
                    <td><label>#{labels['CURRENT_PASSWORD']}:</label></td>
                    <td>
                        <h:inputSecret value="#{authBean.credentials.password}" maxlength="50" styleClass="large"
                                       required="true" requiredMessage="#{labels['FIELD']} '#{labels['CURRENT_PASSWORD']}' #{labels['REQUIRED']}"/>
                    </td>
                </tr>
                <tr>
                    <td><label>#{labels['NEW_PASSWORD']}:</label></td>
                    <td>
                        <h:inputSecret value="#{authBean.credentials.newPassword}" maxlength="50" styleClass="large"
                                       required="true" requiredMessage="#{labels['FIELD']} '#{labels['NEW_PASSWORD']}' #{labels['REQUIRED']}"
                                       validatorMessage="#{labels.get('PASSWORD_MINIMUM_LENGTH', config.minPasswordLength)}">
                            <f:validateLength minimum="#{config.minPasswordLength}"/>
                        </h:inputSecret>
                    </td>
                </tr>
                <tr>
                    <td><label>#{labels['PASSWORD_CONFIRM']}:</label></td>
                    <td>
                        <h:inputSecret value="#{authBean.credentials.passwordConfirm}" maxlength="50" styleClass="large"
                                       required="true" requiredMessage="#{labels['FIELD']} '#{labels['PASSWORD_CONFIRM']}' #{labels['REQUIRED']}"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" class="rj">
                        <h:commandButton value="#{labels['READY']}" action="#{authBean.changePassword}"/>
                    </td>
                </tr>
            </table>
        </h:form>

    </ui:decorate>
</ui:composition>
</html>